# #九九乘法表
# # 使用while实现
# 方式一：正序靠左
# i=1
# while i<=9:
#     a=1
#     while a<=i:
#         print('{}*{}={:<4}'.format(a,i,i*a),end='')
#         a+=1
#     i+=1
#     print()
# print('-'*80)

# 二：倒序靠左
# i=9
# while i>0:
#     a=i
#     while a>0:
#         print('{}*{}={:<4}'.format(a,i,a*i),end='')
#         a-=1
#     i-=1
#     print()
# print('-'*80)

# # 三：正序靠右
# i=1
# while i<=9:
#     a=9
#     while a>0:
#         if a<=i:
#             print('{}*{}={:<4}'.format(a,i,a*i),end='')
#         if a>i:
#             print('{:<8}'.format(' '),end='')
#         a-=1
#     print()
#     i+=1
# print('-'*80)


# 四:倒序靠右
# i=9
# while i>0:
#     a=9
#     while a>0:
#         if a>=i:
#             print(' '*8,end='')
#         if a<=i:
#             print('{}*{}={:<4}'.format(a,i,a*i),end='')
#         a-=1
#     print()
#     i-=1
# print('-'*80)


# j代表空格的次数
# 一：倒序靠右
# i=9
# while i>0:
#     a=9
#     j=1
#     while a>0:
#         if j<=9-i:
#             print(' '*8,end='')
#         if j>9-i:
#             print('{}*{}={:<4}'.format(a,i,i*a),end='')
#         j+=1
#         a-=1
#     i-=1
#     print()
# print('-'*80)

# 二：正序靠右
# i=1
# while i<=9:
#     j=8
#     while j>=i:
#         print('{:8}'.format(''),end='')
#         j-=1
#     k=i
#     while k>=1:
#         print('{}*{}={:<4}'.format(k,i,i*k),end='')
#         k-=1
#     i+=1
#     print()
# print('-'*80)

# 三：倒序靠右
# i=9
# while i>0:
#     j=0
#     while j<9-i:
#         print('{:<8}'.format(''),end='')
#         j+=1
#     a=1
#     while a<=i:
#         print('{}*{}={:<4}'.format(a,i,a*i),end='')
#         a+=1
#     i-=1
#     print()
# print('-'*80)



# for...in...
# 方式一：正序靠左
# i=1
# for i in range(1,10):
#     for a in range(1,i+1):
#         print('{}*{}={:<4}'.format(a,i,i*a),end='')
#     print()
# print('-'*80)

# # 方式二：倒序靠左
# i=9
# for i in range(9,0,-1):
#     for a in range(i,0,-1):
#         print('{}*{}={:<4}'.format(a,i,a*i),end='')
#     print()
# print('-'*80)

# # 方式三：倒序靠右
# i=9
# for i in range(9,0,-1):
#     for k in range(1,10-i):
#         print(' '*8,end='')
#     for a in range(i,0,-1):
#         print('{}*{}={:<4}'.format(a,i,a*i),end='')
#     print()
# print('-'*80)